﻿#include<iostream>
using namespace std;

//将char数字转化为int
int changeCharToInt(char* arc);

int main(unsigned count, char* arc[]) {

	cout << "一共有" << count << "个参数" << endl;
	cout << "地址：" << (int)arc[0] << "参数[" << 0 << "]=[" << arc[0] << "]" << endl;

	int i{ 1 };
	int flag{};


	while (i < count) {
		cout << "地址：" << (int)arc[i] << "参数[" << i << "]=[" << changeCharToInt(arc[i]) << "]" << endl;
		i++;
	}

}

int changeCharToInt(char* arc) {

	int count{}, flag{}, co{};//count记录数字长度，flag记录结果，co记录当前数字的位数
	for (; arc[count] != '\0'; count++);

	co = --count;
	for (int i = 0; i <= count; i++) {
		flag += pow(10, co--) * ((int)(arc[i] - 48));//char数字-48为原本数字
	}
	return flag;

}